import {useState,createContext} from "react"
import ComB from "./ComB"
export const UserContext = createContext()

function ComA() {

    const [user,setUser] = useState("Alan223")

    return (
        <div className="box">
            <h1>ComA</h1>
            <h2>hello,{user}! </h2>
            <UserContext.Provider value={user}>
                <ComB/>
            </UserContext.Provider>
        </div>
    )
}

export default ComA